package com.googlecode.springgameengine.lwjgl;

import com.googlecode.springgameengine.resource.NativeResource;
import org.lwjgl.opengl.GL11;

/**
 *
 * @author Maciej
 */
public class LWJGLMesh extends NativeResource {

    private boolean loaded;
    private int meshList = -1;
    private int numList;

    public LWJGLMesh(int meshList, int numList) {
        this.meshList = meshList;
        this.numList = numList;
        this.loaded = true;
    }

    public int getMeshList() {
        return meshList;
    }

    public int getNumList() {
        return numList;
    }

    @Override
    public void unload() {
        GL11.glDeleteLists(meshList, numList);
        loaded = false;
    }

    @Override
    public boolean isLoaded() {
        return loaded;
    }
}
